package com.tedu.api.io;

import java.io.File;
import java.io.FileFilter;

public class HomeWork2 {
    public static void main(String[] args) {
        File file=new File(".");

        File[] subs=file.listFiles(new FileFilter() {
            public boolean accept(File pathname) {
                String name=pathname.getName();
                System.out.println("获取的名称是："+name);
                return name.startsWith("s");
            }
        });
            if ( subs !=null){
                for (File sub : subs){
                    System.out.println(sub.getName());
                }
        }else {
                System.out.println();
            }

    }

}
